<script type="text/javascript">
  $(function() {
    $( "#main_tabs" ).tabs({ fx: { opacity: 'toggle', duration: 100 } });
  });
</script>

<div id="main_tabs">
<ul>
  <li><a href="#tabs-1">Home</a></li>
  <% if current_user.iscustomer %><li><a href="#tabs-2">Place An Order</a></li><% end %>
  <% if current_user.isdriver %><li><a href="#tabs-3">Deliver An Order</a></li><% end %>
  <% if current_user.isadmin %><li><a href="#tabs-4">Admin Interface</a></li><% end %>
</ul>
<div id="tabs-1">

  <p><font size="4">
  <%= link_to "View All Orders", orders_path %> &nbsp
  <%= link_to "View All Users", users_path %> &nbsp
  <%= link_to "View Available Restaurants", restaurants_path %>
  </font></p>

  <br>

  <% if current_user.iscustomer %>
  <p><font size="4">My Orders:</font><p>
  <%= render "my_orders" %>
  <% end %>

  <br>

  <% if current_user.isdriver %>
  <p><font size="4">My Deliveries:</font><p>
  <%= render "my_deliveries" %>
  <% end %>

</div>

<% if current_user.iscustomer %>
<div id="tabs-2">
  <p><%= render :template => 'orders/_form' %></p>
</div>
<% end %>

<% if current_user.isdriver %>
<div id="tabs-3">
  <p>Pick up an existing order:</p>
  <%= render "pick_orders" %>
</div>
<% end %>

<% if current_user.isadmin %>
<div id="tabs-4">
  <p><%= link_to 'Add a New Restaurant', new_restaurant_path %></p>
  <p><%= link_to "View Current Orders", orders_path %></p>
  <p><%= link_to "List Users", users_path %></p>
  <p><%= link_to "List Restaurants", restaurants_path %></p>
</div>
<% end %>
</div>
